﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ATM.Core.Infrastructure.DependencyInjection
{
    public static class IoC
    {
        private static IServiceResolver resolver = null;

        public static void InitializeWith(IServiceResolver resolverToUse)
        {
            resolver = resolverToUse;
        }

        static IoC()
        {
            resolver = new ServiceResolver();
        }

        public static void AddComponent<Interface, Implementation>(string Key)
        {
            resolver.AddComponent<Interface, Implementation>(Key);
        }

        public static T Resolve<T>()
        {
            return resolver.Resolve<T>();
        }

    }
}
